function merge(arr, left, mid, right, temp) {
  // 定义两个指针
  let i = left;
  let j = mid + 1;
  // 将arr数组中的元素复制到temp中
  for (let k = left; k <= right; k++) {
    temp[k] = arr[k];
  }
  for (let k = left; k <= right; k++) {
    if (i > mid) {
      arr[k] = temp[j++];
    } else if (j > right) {
      arr[k] = temp[i++];
    } else if (temp(j) < temp(i)) {
      arr[k] = temp[j++];
    } else {
      arr[k] = temp(i++);
    }
  }
}

function mergeSort(nums) {
  const temp = [];
}
